<?php
include("../inc/Function.php");
if($_SESSION['a']['alevel']!=5 && $power['qydl']!=1){
	echo "<script>alert('权限不足');window.location.href='index.php';</script>";exit;
}
$page = isset($_GET['page'])?$_GET['page']:1;
$uname = isset($_GET['uname'])?$_GET['uname']:"";
$psize = 15;
$list = agentlist($page,$psize,$uname);
$num = agentnum($uname);
$page1 = page1($num,$psize,$page,$_SERVER['PHP_SELF']."?uname=$uname");
if($list){
    $msg = 1;
}else{
    $msg = 0;
}
$tpl->assign('msg',$msg);
$tpl->assign('glist',$list);
$tpl->assign('dlarr',$dlarr);
$tpl->assign('page',$page1);
$tpl->show('agentlist');
?>